package com.donfu.system.service.house.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.donfu.system.mapper.house.HouseNoveltyMapper;
import com.donfu.system.domain.house.HouseNovelty;
import com.donfu.system.service.house.IHouseNoveltyService;

/**
 * 品牌文章Service业务层处理
 * 
 * @author donfu
 * @date 2021-12-01
 */
@Service
public class HouseNoveltyServiceImpl implements IHouseNoveltyService 
{
    @Autowired
    private HouseNoveltyMapper houseNoveltyMapper;

    /**
     * 查询品牌文章
     * 
     * @param id 品牌文章主键
     * @return 品牌文章
     */
    @Override
    public HouseNovelty selectHouseNoveltyById(Long id)
    {
        return houseNoveltyMapper.selectHouseNoveltyById(id);
    }

    /**
     * 查询品牌文章列表
     * 
     * @param houseNovelty 品牌文章
     * @return 品牌文章
     */
    @Override
    public List<HouseNovelty> selectHouseNoveltyList(HouseNovelty houseNovelty)
    {
        return houseNoveltyMapper.selectHouseNoveltyList(houseNovelty);
    }

    /**
     * 新增品牌文章
     * 
     * @param houseNovelty 品牌文章
     * @return 结果
     */
    @Override
    public int insertHouseNovelty(HouseNovelty houseNovelty)
    {
        houseNovelty.setCreateDate(new Date());
        return houseNoveltyMapper.insertHouseNovelty(houseNovelty);
    }

    /**
     * 修改品牌文章
     * 
     * @param houseNovelty 品牌文章
     * @return 结果
     */
    @Override
    public int updateHouseNovelty(HouseNovelty houseNovelty)
    {
        houseNovelty.setUpdateDate(new Date());
        return houseNoveltyMapper.updateHouseNovelty(houseNovelty);
    }

    /**
     * 批量删除品牌文章
     * 
     * @param ids 需要删除的品牌文章主键
     * @return 结果
     */
    @Override
    public int deleteHouseNoveltyByIds(Long[] ids)
    {
        return houseNoveltyMapper.deleteHouseNoveltyByIds(ids);
    }

    /**
     * 删除品牌文章信息
     * 
     * @param id 品牌文章主键
     * @return 结果
     */
    @Override
    public int deleteHouseNoveltyById(Long id)
    {
        return houseNoveltyMapper.deleteHouseNoveltyById(id);
    }
}
